package com.project.base.entity;

import java.io.Serializable;

/**
 * 基本日志对象
 * Created by lvzimin on 16/1/11.
 */
public class BaseLog implements Serializable {
    private static final long serialVersionUID = 7791522932441281818L;

    /**
     * 设备信息
     */
    public DeviceInfoLog deviceInfo;

    /**
     * 用户信息
     */
    public UserInfoLog userInfo;

    /**
     * 访问信息
     */
    public AccessLog accessLog;

    /**
     * 日志类型
     */
    public String logType;

    /**
     * 记录时间戳
     */
    public String timeStamp;

    public String toLogStr(String seperator) {
        StringBuilder builder = new StringBuilder();
        builder.append(logType).append(seperator);
        builder.append(System.currentTimeMillis()).append(seperator);
        builder.append(deviceInfo.toLogStr(seperator));
        builder.append(userInfo.toLogStr(seperator));
        builder.append(accessLog.toLogStr(seperator));
        return builder.toString();
    }

    public DeviceInfoLog getDeviceInfo() {
        return deviceInfo;
    }

    public void setDeviceInfo(DeviceInfoLog deviceInfo) {
        this.deviceInfo = deviceInfo;
    }

    public UserInfoLog getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfoLog userInfo) {
        this.userInfo = userInfo;
    }

    public AccessLog getAccessLog() {
        return accessLog;
    }

    public void setAccessLog(AccessLog accessLog) {
        this.accessLog = accessLog;
    }

    public String getLogType() {
        return logType;
    }

    public void setLogType(String logType) {
        this.logType = logType;
    }

    public String getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(String timeStamp) {
        this.timeStamp = timeStamp;
    }

}
